﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="OAclient.Common" %>
<%--时间控件Js引用--%>

<script type="text/javascript">

    function checkboxCheckChangeHisdden() {
        var selectchecked = $('#wcdj_selectchecked').val();
        //        alert(selectchecked);
        if (selectchecked == 0) {
            document.getElementById("wcdj_selectchecked").value = "1";
            //            $('#wcdj_selectchecked').val() = "1";
        }
        else {
            document.getElementById("wcdj_selectchecked").value = "0";
            //            $('#wcdj_selectchecked').val() =
        }

    }

</script>

<script type="text/javascript">
    $(function() {
        var options = {
            slide_all: false
        };
        $("#worktable_main").selfAccordion(options);
        tableSelectOrder("#worktable_main .table_style");
    });


    function selectAllRecord() {
        var wcdj_stime = $("#wcdjmrg #wcdj_stime").val();
        var wcdj_etime = $("#wcdjmrg #wcdj_etime").val();
        var searchclrid_wfcurtask = $("#searchclrid_wfcurtask").val();
        var wcdj_selectchecked = $("#wcdjmrg #wcdj_selectchecked").val();
        $.ajax({
            type: "POST",
            url: "/Wcdj/MyTable",
            data: { "wcdj_stime": wcdj_stime, "wcdj_etime": wcdj_etime, "searchclrid_wfcurtask": searchclrid_wfcurtask, "wcdj_selectchecked": wcdj_selectchecked
            },
            success: function(data) {
                $("#wcdjmrg #mytable").html(data);
                // $("#searchclrid_wfcurtask").val(null);
            }
        });
    }

    function addMrg() {
        var mrg_message = document.getElementById("mrg_message").value;
        var mrg_time = $("#wcdjmrg #mrg_time").val();
        var sure = document.getElementById("sure").name;
        //        alert(sure);
        $.ajax({
            type: "POST",
            url: "/Wcdj/WcdjMrg",
            data: { "mrg_message": mrg_message, "mrg_time": mrg_time, "sure": sure
            },
            success: function(data) {
                $("#wcdjmrg").html(data);
                $("#sure").val("");
            }
        });
    }

    //    function WcdjImport() {
    //        var wcdj_stime = $("#wcdjmrg #wcdj_stime").val();
    //        var wcdj_etime = $("#wcdjmrg #wcdj_etime").val();
    //        var searchclrid_wfcurtask = $("#searchclrid_wfcurtask").val();
    //        var wcdj_selectchecked = $("#wcdjmrg #wcdj_selectchecked").val();
    //        $.ajax({
    //            type: "POST",
    //            url: "/Wcdj/WcdjImport",
    //            data: { "wcdj_stime": wcdj_stime, "wcdj_etime": wcdj_etime, "searchclrid_wfcurtask": searchclrid_wfcurtask, "wcdj_selectchecked": wcdj_selectchecked
    //            },
    //            success: function(data) {
    //                alert(data);
    //                // $("#searchclrid_wfcurtask").val(null);
    //            }
    //        });
    //    }
</script>

<script type="text/javascript">
    $(function() {
        $("#searchclrname_wfcurtask").autocomplete({
            source: function(request, response) {
                $.ajax({
                    url: "/Home/SearchUserFormAll",  //要查询的Action
                    type: "POST",  //Post提交
                    dataType: "json", //json格式数据，默认是text
                    data: { keyword: request.term }, //参数，不知道为什么？请指点
                    success: function(data) {
                        response($.map(data, function(item) {
                            return { label: item.text, value: item.value }; //将返回的jsonresult的属性赋值给autocomplete item
                        }))
                    }
                })
            },
            select: function(event, ui) {
                var t = ui.item.label; //'马军 事业部 员工'
                var arr = t.split(' ');
                $('#searchclrname_wfcurtask').val(arr[0]);  //选中item的文本
                $('#searchclrid_wfcurtask').val(ui.item.value); //选中item的值
                return false;
            },
            minLength: '0'
        })

        tableSelectOrder("#wcdjmrg .table_style");

        $("#wcdjmrg #btn_query").trigger("click");
    });
                       
</script>

<script type="text/javascript">
    function showtxt() {
        var asd1 = document.getElementById("sure").name;
        document.getElementById(asd1).innerHTML = document.getElementById("mrg_message").value;
        document.getElementById("manage").style.display = 'none';
    }
</script>

<div style="padding-top: 35px">
    <div id="wcdjmrg">
        <input type="button" value="导出" />
        <form action="/Wcdj/WcdjMrg" method="post">
        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width: 15%;">
                    被查询人
                </td>
                <td>
                    <%=Html.TextBox("searchclrname_wfcurtask")%>
                    <%=Html.Hidden("searchclrid_wfcurtask")%>
                </td>
                <td>
                    开始时间:<input id="wcdj_stime" name="wcdj_stime" class="Wdate" type="text" value="<%=DateTime.Now.ToString("yyyy-MM-dd") %>"
                        onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'wcdj_etime\')||\'2020-10-01\'}'})" />
                </td>
                <td>
                    到:<input id="wcdj_etime" name="wcdj_etime" class="Wdate" type="text" value="<%=DateTime.Now.ToString("yyyy-MM-dd") %>"
                        onfocus="WdatePicker({minDate:'#F{$dp.$D(\'wcdj_stime\')}',maxDate:'2020-10-01'})" />
                </td>
                <td>
                    <input type="checkbox" id="checkbox1" name="checkbox" checked="checked" onclick="checkboxCheckChangeHisdden()" />仅显示被管理过的用户
                    <input type="hidden" id="wcdj_selectchecked" name="wcdj_selectchecked" value="1" />
                    <input id="btn_query" class="btn_style" type="button" value="查 询" onclick="selectAllRecord();" />
                    <a class="btn_style" href='/Wcdj/WcdjDerive'>导 出</a>
                </td>
            </tr>
        </table>
        </form>
        <div id="mytable">
        </div>
    </div>
</div>
